#ifndef _ENABLEEVENTHANDLE_H_
#define _ENABLEEVENTHANDLE_H_

#include <SECore/Event.h>
#include <vector>
#include <SECore/EventHandler.h>

namespace SEngine
{
    class EventHandler;
    class EnableEventHandle
    {
    public:
        virtual ~EnableEventHandle() = default;
        void AddEventHandler(std::unique_ptr<EventHandler> && handler) { m_handlers.emplace_back(std::move(handler)); }
    protected:
        void OnEventImpl(EventPtr);
        void OnUpdateImpl(int delta);
    
    private:
        std::vector<std::unique_ptr<EventHandler>> m_handlers;
    };
} // namespace SEngine


#endif